extends ColorRect
var target_col:Vector3
func set_target(v:Color):
		target_col=Vector3(v.r,v.g,v.b)
var col:Vector3:
	set(v):
		col=v
		material.set_shader_parameter("bk_color",col)
func _ready() -> void:
	var c=material.get_shader_parameter("bk_color")
	if c is Color:
		col.x=c.r
		col.y=c.g
		col.z=c.b
	elif c is Vector3:
		col=c
	default()
func default()->void:
	set_target(Color("969696"))
func black()->void:
	set_target(Color.BLACK)
func white()->void:
	set_target(Color.WHITE)
func sun()->void:
	set_target(Color.ORANGE_RED)
func water()->void:
	set_target(Color.DODGER_BLUE)
func _process(delta: float) -> void:
	if col!=target_col:
		col=col.move_toward(target_col,delta)
